Skip to content

Add Xote and Xote SSR templates#124

Open
brnrdog wants to merge 2 commits intorescript-lang:masterfrom
brnrdog:brnrdog/xote-templates
Open

Add Xote and Xote SSR templates#124
brnrdog wants to merge 2 commits intorescript-lang:masterfrom
brnrdog:brnrdog/xote-templates

Conversation

@brnrdog
Copy link
Copy Markdown

@brnrdog brnrdog commented Apr 28, 2026

Summary

  • Adds two new templates:
    • rescript-template-xote — Xote with Vite, rescript-signals and Tailwind 4 (CSR)
    • rescript-template-xote-ssr — Xote with Vite, rescript-signals and Tailwind 4 (SSR via Node server)
  • Groups both under a single "Xote" entry in the interactive picker; selecting it prompts a follow-up question for CSR or SSR.
  • CLI flags --template xote and --template xote-ssr resolve directly to each variant for non-interactive use.
  • Follows existing template conventions: name fields aligned to the folder name, res:* scripts ordered first in package.json, _gitignore (renamed to .gitignore on copy), and rescript left out of devDeps so CRA installs the user-selected version.

Test plan

  • npm test passes
  • Interactive flow: picking "Xote" prompts a CSR/SSR follow-up
  • npm create rescript-app@latest my-app -- --template xote scaffolds and npm run dev works
  • npm create rescript-app@latest my-app -- --template xote-ssr scaffolds and npm run dev works

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 28, 2026

Open in StackBlitz

npx https://pkg.pr.new/create-rescript-app@124

commit: d77ce90

@brnrdog brnrdog marked this pull request as draft April 28, 2026 19:43
@brnrdog brnrdog force-pushed the brnrdog/xote-templates branch from 15afa23 to d77ce90 Compare April 28, 2026 19:53
@brnrdog brnrdog marked this pull request as ready for review April 28, 2026 19:59
Comment thread src/NewProject.res
@fhammerschmidt
Copy link
Copy Markdown
Member

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d77ce901e3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"res:clean": "rescript clean",
"res:dev": "rescript -w",
"dev": "node server.mjs",
"start": "NODE_ENV=production node server.mjs",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use a cross-platform start script for SSR template

The start script uses POSIX-only env-var syntax (NODE_ENV=production ...), which fails in Windows shells (cmd/PowerShell), so npm run start is broken for Windows users of the new SSR template. Because this is the documented production entrypoint, the template should set production mode in a cross-platform way (for example via cross-env or server-side defaulting) so the command works across supported OSes.

Useful? React with 👍 / 👎.

},
"devDependencies": {
"@tailwindcss/vite": "^4.0.0",
"rescript": "^12.0.0-beta.1",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Regenerate lockfiles to match template manifests

This lockfile still includes rescript in the root devDependencies even though the corresponding template package.json omits it, and the same mismatch exists in templates/rescript-template-xote-ssr/package-lock.json. That inconsistency can break npm ci (which requires lockfile/package.json parity) and also defeats the intended behavior of deferring the ReScript version choice to the scaffolder. Rebuild these lockfiles from the current package.json files so top-level deps are synchronized.

Useful? React with 👍 / 👎.

@fhammerschmidt
Copy link
Copy Markdown
Member

fhammerschmidt commented Apr 30, 2026

Can you

  • address the issues codex found
  • format the templates .res file with ReScript 12, I immediately had changes after pressing CMD + S

?

Thank you for this, it's super nice. I especially like how minimalist the CSR template is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants